.spell File Specification and Future Vision

The .spell file is the cornerstone of the Magi ecosystem, currently functioning as a simple mechanism for defining and executing command macros. However, the roadmap for .spell files envisions their evolution into a robust, modular, and self-contained scripting format, while maintaining their lightweight nature. This document outlines the current functionality and future plans, including features like bundling artifacts, procedural sigil confirmation, and API integrations.


Current Functionality

Purpose

Structure

A .spell file is plain text, designed for simplicity and usability.

Components

  1. Description:
  2. A concise explanation of the spell’s purpose.
    plaintext # Description: A spell to archive files

  3. Commands:

  4. A series of commands executed when the spell is cast.
    plaintext # Commands: tar -czvf {{archive_name}}.tar.gz {{directory}}

  5. Parameters:

  6. Placeholders in commands that can be dynamically replaced at runtime.
    plaintext # Parameters: # directory: The target directory to archive # archive_name: The name of the output archive

  7. Alias:

  8. A shorthand name for invoking the spell.
    plaintext # Alias: archive

Execution

Casting a Spell

Examples

  1. Casting with Prompt:
    bash cast ponder archive
    Prompts the user to enter the required parameters.

  2. Direct Invocation:
    bash cast ponder archive --directory=docs --archive_name=docs_backup


Roadmap

Phase 0: Command Macros (Current State)


Phase 1: Enhancements and Synchronization

Enhancements

  1. Artifact Bundling:
  2. Package .spell files with non-code artifacts, such as templates, configuration files, or static assets required for execution.
  3. These artifacts will travel with the .spell file, ensuring portability and reproducibility.

Example:
plaintext # Artifacts: # /templates/report_template.md # /configs/default_config.json

  1. Chamber Integration:
  2. CI/CD pipelines for automatic spell validation and distribution.

Phase 2: Structured Format and Modularity

Enhancements

  1. Lightweight Bundles:
  2. .spell files will serve as portable bundles carrying:
    • Command logic
    • Required artifacts (templates, configs, static files)
    • Metadata for validation and execution

Example:
yaml name: ArchiveDirectory alias: archive description: A spell to archive files in a directory version: 1.0.0 parameters: directory: type: string required: true archive_name: type: string required: true commands: - tar -czvf {{archive_name}}.tar.gz {{directory}} artifacts: - templates/report_template.md - configs/default_config.json

  1. Containerized Execution:
  2. Enable spells to define runtime environments using containers for modularity and isolation.

Phase 3: Ecosystem Integration

New Features

  1. Procedural Sigil Confirmation:
  2. Each .spell file is associated with a procedurally generated sigil.
  3. The sigil serves as a visual and cryptographic confirmation key, validated by the Magi API.

Example Workflow:
- Users submit a .spell file to the API for casting.
- The API generates and returns a unique sigil that confirms the spell's validity and execution status.

  1. Levels of Spells:
  2. Introduce levels to differentiate spells by maturity and execution environment:

    • Level 1: CLI-castable spells. Python scripts in the spells directory.
    • Level 2: Fully reviewed, documented spells with artifact bundling but no browser integration.
    • Level 3: Spells integrated with browser interfaces and APIs, offering user-friendly execution and advanced features.
  3. API Casting:

  4. Publish .spell logic as APIs, allowing third-party systems to invoke spells programmatically.

Phase 4: Advanced Monetization

Premium Features

  1. Browser Integration:
  2. Users can cast Level 3 spells directly from the browser.
  3. A polished UI simplifies parameter input and displays results interactively.

  4. Subscription Model:

  5. Users receive a free first use of each spell.
  6. Beyond the initial use, access is gated by a subscription package (e.g., $5 for a set number of casts).

Call to Action

  1. Collaborate:
  2. Contribute to Magi.Spells by developing new .spell files and submitting them for review.

  3. Experiment:

  4. Test the current macro capabilities of .spell files and provide feedback.

  5. Innovate:

  6. Help shape the future of .spell files by proposing features and use cases.

This roadmap ensures that .spell files will evolve from basic command macros to a cornerstone of the Magi ecosystem, enabling automation, collaboration, and monetization in a modular and secure framework.